//
//  HomeFind.m
//  SXH
//
//  Created by 房 国生 on 15/7/24.
//  Copyright (c) 2015年 lyss. All rights reserved.
//

#import "HomeFind.h"
#import "FindEntity.h"

@implementation HomeFind

- (instancetype)initWithAttributes:(NSDictionary *)attributes {
    
    self = [super init];
    if (!self) {
        return nil;
    }
    
    self.parkid= [attributes valueForKeyPath:@"park_id"];
    self.parkname = [attributes valueForKeyPath:@"park_name"];
    self.travelCount = [attributes valueForKeyPath:@"travel_count"];
    
    self.travelRows = [[NSMutableArray alloc] init];
    
    NSArray *arrayRows = [attributes valueForKeyPath:@"travelRows"];
    
    for (NSDictionary* attributes in arrayRows) {
        FindEntity *entity = [[FindEntity alloc] init];
        entity = [entity initWithAttributes:attributes];
        [self.travelRows addObject:entity];
    }
    
    return self;
}


@end
